import request from '@/config/axios'

// 文章收藏 VO
export interface ArticleFavoriteVO {
  id: number // ID
  articleId: number // 文章id
  mid: number // 所属用户
}

// 文章收藏 API
export const ArticleFavoriteApi = {
  // 查询文章收藏分页
  getArticleFavoritePage: async (params: any) => {
    return await request.get({ url: `/cms/article-favorite/page`, params })
  },

  // 查询文章收藏详情
  getArticleFavorite: async (id: number) => {
    return await request.get({ url: `/cms/article-favorite/get?id=` + id })
  },

  // 新增文章收藏
  createArticleFavorite: async (data: ArticleFavoriteVO) => {
    return await request.post({ url: `/cms/article-favorite/create`, data })
  },

  // 修改文章收藏
  updateArticleFavorite: async (data: ArticleFavoriteVO) => {
    return await request.put({ url: `/cms/article-favorite/update`, data })
  },

  // 删除文章收藏
  deleteArticleFavorite: async (id: number) => {
    return await request.delete({ url: `/cms/article-favorite/delete?id=` + id })
  },

  // 导出文章收藏 Excel
  exportArticleFavorite: async (params) => {
    return await request.download({ url: `/cms/article-favorite/export-excel`, params })
  }
}